// TODO: Next
import React, {
  FC,
	useRef,
	useMemo,
	useState,
	useCallback
} from 'react'

import axios from 'axios'
import {message} from 'antd'

import { useWorkspaceConetxt } from '@/context'
import { unifiedTime } from "@/utils/time";

import css from './SharedWithAllPage.less'

const pageSize = 50

const SharedWithAllPage: FC = () => {
  const { apps: { getApp } } = useWorkspaceConetxt();

	const scrollRef = useRef<HTMLDivElement>()
	const [fileList, setFileList] = useState([])
	const [total, setTotal] = useState(0)
	const [pageIndex, setPageIndex] = useState(0)
	const [loading, setLoading] = useState(true)

	useMemo(() => {
		setLoading(true)
		axios({
			method: 'post',
			url: '/paas/api/share/getAll',
			data: {
				pageSize: pageSize,
				page: pageIndex
			}
		}).then(({data:{code, data}}) => {
			if (code === 1) {
				setFileList((list) => {
					return list.concat(data.list)
				})
				setTotal(data.total)
			} else { 
				message.error(`获取数据发生错误：${data.message}`)
			}
		}).finally(() => {
			setLoading(false)
		})
	}, [pageIndex])

	const onClick = useCallback(({id, homepage}) => {
		window.open(`${homepage}?id=${id}`)
	}, [])

	const onScroll = useCallback(() => {
		if (loading || total === 0 || (total && (pageIndex + 1) * pageSize >= total)) {
			return
		}

		const container = scrollRef.current

		let scrollTop, clientHeight, scrollHeight;
		scrollTop = container.scrollTop || 0;
		clientHeight = container.clientHeight;
		scrollHeight = container.scrollHeight;

		if (scrollTop + clientHeight >= scrollHeight - 500) {
			setPageIndex(pageIndex + 1)
		}
	}, [loading, total, pageIndex, pageSize]);

	const list = useMemo(() => {
		// const {APPSMap} = appCtx

		return fileList.map((file) => {
			const {
				id, 
				name,
				icon,
				path,
				extName,
				createTime
			} = file
			// const appReg = APPSMap[extName]
      const appReg = getApp(extName)
			
			return (
				<div key={id} className={css.file} onClick={() => onClick({id, homepage: appReg.homepage})}>
					<div className={css.snap}>
						<Icon icon={icon || appReg?.icon} width={icon ? 140 : 32} height={icon ? '100%' : 32}/>
					</div>
					<div className={css.tt}>
						<div className={css.typeIcon}>
							<Icon icon={appReg?.icon} width={18} height={18}/>
						</div>
						<div className={css.detail}>
							<div className={css.name}>
								{name}
							</div>
							<div className={css.path} data-content-start={path}>
								{unifiedTime(createTime)}
							</div>
						</div>
					</div>
				</div>
			);
		})
	}, [fileList])

	const empty = useMemo(() => {
		if (total === 0 && !loading) {
			return <div className={css.loading}>暂无分享内容</div>
		}

		return null
	}, [total, loading])

	const spin = useMemo(() => {
		return (((!total || total < 0) && loading) || (total && loading)) ? <div className={css.loading}>加载中...</div> : null;
	}, [total, loading])

	const noMore = useMemo(() => {
		if (!loading && (pageIndex + 1) * pageSize >= total && total > 0) {
			return <div className={css.loading}>- 没有更多了 -</div>
		}

		return null
	}, [loading, pageIndex, pageSize, total])

	return (
		<div
      ref={scrollRef}
      className={css.files}
      onScroll={onScroll}
    >
      {list}
      {empty}
      {spin}
      {noMore}
    </div>
	)
}

export default SharedWithAllPage;

export function Icon({icon, onClick, className, width = '100%', height = '100%', style = {}}: any): JSX.Element {
  const iconType = typeof icon

  if (iconType === 'string') {
    if (icon.startsWith('Mybricks')) {
      const JSXIcon: any = mybricksIconMap[icon]
      return <JSXIcon width={width} height={height}/>
    } else {
      // const src = ((icon as string).startsWith('http') ? icon : getApiUrl(icon)) as string
      const src = icon
      return <img draggable={false} className={className} src={src} onClick={onClick} width={width} height={height} style={style}/>
    }
  }

  if (iconType === 'function') {
    return (icon as ((...args: any) => JSX.Element))({onClick, className, width, height, style})
  }

  return icon as JSX.Element
}

/** 协作组默认图标 */
export function MybricksGroupIcon0({width, height}) {
  return (
    <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4077" width={width} height={height}><path d="M886.066133 905.662896v22.571958c0 15.88301-12.872883 28.757888-28.755893 28.757889H166.955242c-14.839046 0-26.861588-12.032522-26.861589-26.869573V905.652916H32.934739v39.22746C32.934739 987.479258 67.461371 1022.005891 110.050273 1022.005891h806.05924c42.588902 0 77.115534-34.526633 77.115534-77.123519v-39.22746h-107.158914z m0 0" fill="#4F7693" p-id="4078"></path><path d="M772.258192 964.228624H257.037476c-24.757693 0-44.826536-20.070838-44.826536-44.83452v-10.020448c0-2.05 1.66076-3.712756 3.71076-3.712756h597.458256c2.044012 0 3.712756 1.662756 3.712756 3.712756v10.020448c0 24.763682-20.078823 44.832524-44.83452 44.832524z m0 0" fill="#FFAE85" p-id="4079"></path><path d="M813.379956 905.662896H215.9217c-2.05 0-3.712756 1.66076-3.712756 3.712756v10.018452c0 2.846446 0.289435 5.613048 0.796446 8.311782h522.628262c17.396057 0 30.706087 16.092601 26.745815 33.029554-0.34333 1.457157-0.75852 2.658812-1.247566 3.493184h11.126291c24.763682 0 44.832524-20.078823 44.832524-44.83452v-10.028433a3.712756 3.712756 0 0 0-3.71076-3.702775z m0 0" fill="#EA9E7D" p-id="4080"></path><path d="M140.093653 731.153394H69.36366l5.730818-42.051949 3.60297-26.408473 54.852972 3.359445 2.22965 22.214656z m0 0" fill="#FEDFC5" p-id="4081"></path><path d="M314.916544 851.548483l-71.789926 0.259493-97.817142-117.163394a68.354628 68.354628 0 0 0-75.945816-3.477215l-8.772883 5.301655a34.989729 34.989729 0 0 0-16.79523 27.360615L32.934739 905.662896h107.158914v-75.572545l72.117287 75.752195h143.280435v-3.329504c-0.005988-24.366457-16.833156-45.505212-40.574831-50.964559z m0 0" fill="#FF84A7" p-id="4082"></path><path d="M135.78007 688.267073a59.693528 59.693528 0 0 1-31.047421 8.669085c-10.798929 0-20.90521-2.836466-29.638171-7.834713l3.60297-26.408473 54.852972 3.359445z m0 0" fill="#FECBAA" p-id="4083"></path><path d="M169.54419 559.362587v57.082622c0 33.099417-26.823662 59.92308-59.899126 59.92308-23.945279 0-44.592991-14.028628-54.184278-34.33301a59.77936 59.77936 0 0 1-5.728822-25.59007v-57.082622c0-23.907353 19.382182-43.267578 43.265582-43.267577h33.301024c21.551948 0 39.393137 15.735298 42.682718 36.367042a41.978094 41.978094 0 0 1 0.560906 6.900535z m0 0" fill="#FEDFC5" p-id="4084"></path><path d="M168.981288 552.462052l-63.438221 25.114996a14.152386 14.152386 0 0 0-8.942551 13.154334v15.06261c0 4.630964-2.255599 8.942552-6.020254 11.587391l-35.119476 24.655892a59.77936 59.77936 0 0 1-5.728822-25.590069v-57.084619c0-23.907353 19.382182-43.267578 43.265582-43.267577h33.301024c21.551948 0 39.393137 15.735298 42.682718 36.367042z m0 0" fill="#C97F4C" p-id="4085"></path><path d="M956.796126 731.153394h-70.735982l3.313535-32.945717 3.227702-32.157256 54.852973-3.359445 4.195813 30.660177z m0 0" fill="#FEDFC5" p-id="4086"></path><path d="M993.225047 905.662896l-10.860808-141.833259a35.007694 35.007694 0 0 0-16.79523-27.360615l-8.772883-5.301655a68.354628 68.354628 0 0 0-75.945816 3.477215l-97.817142 117.161398-71.789926-0.257497c-23.74966 5.459348-40.576828 26.598103-40.576827 50.964559v3.321519h143.284427l72.115291-75.752194v75.572545h107.158914z m0 0" fill="#83D9FF" p-id="4087"></path><path d="M951.650167 693.351153a59.693528 59.693528 0 0 1-35.143429 11.383788c-9.768939 0-19.002922-2.339435-27.133059-6.527264l3.227702-32.157256 54.852973-3.359445z m0 0" fill="#FECBAA" p-id="4088"></path><path d="M976.429818 559.362587v57.082622c0 9.146154-2.065969 17.841189-5.730819 25.59007-9.591286 20.304383-30.244987 34.33301-54.192261 34.33301-33.075464 0-59.89713-26.831647-59.897131-59.92308v-57.082622c0-2.355404 0.193622-4.648929 0.56889-6.900535 3.289581-20.631744 21.13077-36.369038 42.682719-36.369038h33.324977c23.873419 0 43.243624 19.370205 43.243625 43.269573z m0 0" fill="#FEDFC5" p-id="4089"></path><path d="M976.429818 559.362587v57.082622c0 9.146154-2.065969 17.841189-5.730819 25.59007l-35.119475-24.645912a14.154382 14.154382 0 0 1-6.028238-11.595375v-15.064607a14.146398 14.146398 0 0 0-8.934567-13.154333l-63.446206-25.107012c3.297566-20.631744 21.138755-36.365046 42.682719-36.365046H933.178209c23.883399-0.007984 43.251609 19.360225 43.251609 43.259593z m0 0" fill="#C97F4C" p-id="4090"></path><path d="M449.168595 156.694263v242.379076c0 7.02629-2.541042 13.441773-6.750828 18.424052a28.45448 28.45448 0 0 1-21.801462 10.128238H197.471699c-4.980283 0-9.503457 2.91631-11.483594 7.463437-7.688997 17.715434-25.342552 30.097275-45.894452 30.097275-20.545911 0-38.199466-12.381841-45.910421-30.097275-1.982133-4.547128-6.503311-7.463438-11.463632-7.463437H78.28625c-15.77522 0-28.554286-12.795035-28.554286-28.55229V156.694263c0-15.773224 12.779066-28.554286 28.554286-28.554286h342.332051c15.781208 0 28.55229 12.781062 28.55229 28.554286z m0 0M977.052602 156.694263v242.379076c0 15.757255-12.779066 28.55229-28.552289 28.55229h-4.437342c-4.96631 0-9.489484 2.91631-11.461636 7.463437-7.710955 17.715434-25.364509 30.097275-45.918406 30.097275-20.521958 0-38.175513-12.381841-45.886467-30.097275-1.980136-4.547128-6.503311-7.463438-11.461637-7.463437H606.168262c-11.587391 0-21.575902-6.914509-26.05117-16.833156a28.504383 28.504383 0 0 1-2.503116-11.719134V156.694263c0-15.773224 12.773078-28.554286 28.554286-28.554286h342.332051c15.773224 0 28.55229 12.781062 28.552289 28.554286z m0 0" fill="#A7C7D3" p-id="4091"></path><path d="M722.776738 0H293.520291c-19.781403 0-35.81412 16.030721-35.81412 35.812124v294.32572c0 19.773419 16.032717 35.812124 35.81412 35.812125h142.689589c6.22186 0 11.898783 3.64888 14.38593 9.357741 9.653165 22.206671 31.789972 37.738366 57.559691 37.738366 25.761734 0 47.898542-15.525707 57.559691-37.738366 2.479163-5.708861 8.156086-9.357741 14.377947-9.357741h142.681603c19.781403 0 35.822105-16.030721 35.822105-35.812125V35.810128C758.598843 16.030721 742.558141 0 722.776738 0z m0 0" fill="#E9EDF1" p-id="4092"></path><path d="M449.168595 156.694263v242.379076c0 7.02629-2.541042 13.441773-6.750828 18.424052a93.645282 93.645282 0 0 1-15.735298-20.28043H293.52628c-36.997811 0-67.089098-30.089291-67.089098-67.079117V128.139977h194.177127c15.781208 0 28.55229 12.781062 28.55229 28.554286z m0 0M789.857852 128.139977v201.997867c0 36.98783-30.099271 67.079117-67.089098 67.079117h-133.13024a93.27201 93.27201 0 0 1-9.521422 13.573516 28.504383 28.504383 0 0 1-2.503116-11.717138V156.694263c0-15.773224 12.773078-28.554286 28.554286-28.554286z m0 0" fill="#89B4C9" p-id="4093"></path><path d="M722.776738 0H293.520291c-19.781403 0-35.81412 16.030721-35.81412 35.812124v294.32572c0 19.773419 16.032717 35.812124 35.81412 35.812125h142.689589c6.22186 0 11.898783 3.64888 14.38593 9.357741 9.653165 22.206671 31.789972 37.738366 57.559691 37.738366 25.761734 0 47.898542-15.525707 57.559691-37.738366 2.479163-5.708861 8.156086-9.357741 14.377947-9.357741h142.681603c19.781403 0 35.822105-16.030721 35.822105-35.812125V35.810128C758.598843 16.030721 742.558141 0 722.776738 0z m0 0" fill="#E9EDF1" p-id="4094"></path><path d="M670.666415 103.54796H337.254958a15.627508 15.627508 0 0 1-15.633497-15.633496 15.625512 15.625512 0 0 1 15.633497-15.625512h333.411457a15.629504 15.629504 0 1 1 0 31.259008z m0 0M670.666415 182.791343H337.254958a15.627508 15.627508 0 0 1-15.633497-15.633497 15.625512 15.625512 0 0 1 15.633497-15.625512h333.411457a15.629504 15.629504 0 1 1 0 31.259009z m0 0M517.177897 262.034725h-179.922939a15.625512 15.625512 0 0 1-15.633497-15.625512 15.627508 15.627508 0 0 1 15.633497-15.633496h179.922939a15.627508 15.627508 0 0 1 15.633496 15.633496 15.625512 15.625512 0 0 1-15.633496 15.625512z m0 0" fill="#A7C7D3" p-id="4095"></path><path d="M448.42804 744.641077a43.762612 43.762612 0 0 0 15.797177-9.381694 43.898347 43.898347 0 0 0 13.942795-32.069427v-40.437101h72.957647v40.437101a43.702728 43.702728 0 0 0 12.134324 30.260955 43.115874 43.115874 0 0 0 17.613633 11.190166z m0 0" fill="#FEDFC5" p-id="4096"></path><path d="M551.133644 662.752855v25.965337l-16.607596 10.128238a38.159544 38.159544 0 0 1-39.75044 0l-16.607596-10.128238v-25.965337z m0 0" fill="#FECBAA" p-id="4097"></path><path d="M585.935739 534.519061v88.555214a38.30526 38.30526 0 0 1-18.340215 32.700196l-33.075465 20.148687a38.179505 38.179505 0 0 1-39.742455 0L461.698148 655.774471a38.271326 38.271326 0 0 1-18.340216-32.700196V534.517065c0-24.366457 19.72152-44.10195 44.016117-44.101949h54.519623c24.326535 0 44.038074 19.735493 44.038074 44.101949z m0 0" fill="#FEDFC5" p-id="4098"></path><path d="M541.895668 490.419108h-33.356915c24.31855 0 44.038074 19.733497 44.038075 44.099953v88.555214a38.313244 38.313244 0 0 1-18.346204 32.700196l-33.069476 20.148687c-1.043963 0.638754-2.111879 1.193671-3.195764 1.722639a38.165532 38.165532 0 0 0 36.552679-1.722639l33.075464-20.148687a38.325221 38.325221 0 0 0 18.340216-32.700196V534.517065c0-24.366457-19.711539-44.10195-44.038075-44.101949z m0 0" fill="#FECBAA" p-id="4099"></path><path d="M585.935739 534.519061v41.13973l-94.551514-30.44859-48.024296 25.06709v-35.75823c0-24.366457 19.72152-44.10195 44.016117-44.101949h54.519622c24.326535 0 44.038074 19.735493 44.038075 44.101949z m0 0" fill="#618AAA" p-id="4100"></path><path d="M541.801851 490.419108h-33.356914c24.31855 0 44.03009 19.733497 44.030089 44.099953v30.394695l33.3649 10.745035v-41.13973c0-24.366457-19.719524-44.10195-44.038075-44.101949z m0 0" fill="#4F7693" p-id="4101"></path><path d="M365.879107 905.67088v-74.145329c0-35.305114 22.502095-66.665923 55.930869-77.925953l26.618064-8.958521a43.570986 43.570986 0 0 0 15.789192-9.387683 137.64543 137.64543 0 0 0 50.138172 8.27186c18.72746-0.405209 35.103507-4.513194 48.896595-10.074343a43.379359 43.379359 0 0 0 17.621617 11.190166l26.620059 8.958521c33.402825 11.258034 55.920889 42.620839 55.920889 77.927949v74.143333z m0 0" fill="#69D998" p-id="4102"></path><path d="M512.918208 743.768779l-31.304918 110.658087a8.645132 8.645132 0 0 0 1.888315 8.132133l23.298541 25.973322a8.655112 8.655112 0 0 0 12.583447 0.319377l25.919427-26.144987a8.653116 8.653116 0 0 0 2.119864-8.669085z m0 0" fill="#3DC5A1" p-id="4103"></path></svg>
  )
}
export function MybricksGroupIcon1({width, height}) {
  return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2388" width={width} height={height}><path d="M548.846536 825.037148l-77.10295 2.965498c-152.54522-9.798006-272.268308-75.442271-359.181126-196.909072-18.741948-26.215003-11.150273-58.835482 27.519823-46.380389 2.170745 0.735444 5.219277 3.475564 8.303394 7.473055l35.704597 46.02453 44.126611 43.889371c122.024314 95.453452 250.489691 118.264063 385.396129 68.443695 261.675549-96.675237 334.508182-406.866335 162.983773-618.958756-12.016198-18.421674-27.472374-32.573031-46.380389-42.465932l-44.245232-37.246656c-3.890733-3.2146-6.524096-6.346166-7.117195-8.422014-6.405476-20.473799 0.830339-32.893305 21.707446-37.246656 3.582322-0.759168 7.508641 0.05931 10.913033 2.253778 351.114971 227.038532 238.188805 730.580103-162.627914 816.579548z" fill="#FDDD44" p-id="2389"></path><path d="M631.880482 107.386616l-0.47448 20.284007c-2.763844 29.821049-18.421674 40.496842-46.973489 32.027379a15.764588 15.764588 0 0 0-13.427776 2.135158c-4.033077 2.728258-6.84437 7.129057-7.686571 12.099233l-4.626177 27.638442c-0.53379 3.558598-2.728258 6.915541-6.049616 9.252353-22.134478 15.823898-53.058691 29.500775-92.760779 41.042494-28.148508 8.149189-32.656065 21.826066-13.522671 41.042493 2.6215 2.633362 6.144512 4.448247 10.082693 5.219277l100.352455 19.453667c4.329627 0.830339 7.793329 3.012946 9.370974 5.930996l25.977763 46.61763c2.218193 3.997491 5.266725 6.642716 8.066154 6.998575l58.479622 7.947535c4.294041 0.604962 7.781467 2.431708 9.489594 4.982037 12.2653 17.721816 12.656746 35.941837 1.186199 54.683784-1.743713 2.894326-4.982037 5.195553-9.015114 6.405476-42.228692 13.048191-31.31566 63.698898-10.675793 89.202182 2.846878 3.641632 2.099573 7.674709-2.253778 12.099232-88.727702 91.028929-193.896126 119.450262-315.528995 85.287724l39.500435-39.619054c2.253779-2.241917 6.334304-2.38426 9.964073-0.35586 28.551815 15.978104 58.479622 24.993218 89.795282 27.045342 49.986435-18.896154 59.903061-47.483555 29.7736-85.762204a12.336472 12.336472 0 0 1-2.253778-10.319933l23.842604-104.504152a17.911608 17.911608 0 0 0-1.186199-11.268892c-16.915201-37.875341-40.449394-40.876425-70.578854-9.015114-31.861311 18.908016-70.341614 17.520163-115.417185-4.151698a29.477051 29.477051 0 0 1-16.250929-20.877106c-8.540634-43.177652-9.252354-92.16768-63.817519-102.962093-2.668948-0.521928-6.54782 0.23724-10.794413 2.135159l-68.799555 30.48532c59.072721-200.467669 267.369306-297.973246 456.212223-201.179389zM450.937652 174.964386c-0.545652-9.015114-11.802682-15.681554-25.147424-14.863076-13.344741 0.818477-23.712123 8.789736-23.154609 17.816712 0.545652 9.015114 11.814544 15.681554 25.147424 14.863076 13.344741-0.818477 23.712123-8.789736 23.154609-17.816712z" fill="#63B9FC" p-id="2390"></path><path d="M730.216398 89.119148c18.908016 9.892902 34.364192 24.044258 46.380389 42.465932l-52.785865 49.938988-41.516973-44.482471 47.922449-47.922449z" fill="#F2671E" p-id="2391"></path><path d="M631.880482 107.386616l50.413467 29.654981 41.516973 44.482471c86.355304 118.311511 94.777318 241.593196 25.266043 369.856918l-88.015982-11.506132c92.606574-142.735353 83.674493-276.977519-26.808103-402.714637a12.44323 12.44323 0 0 1-2.846878-9.489594l0.47448-20.284007z" fill="#22B69F" p-id="2392"></path><path d="M631.406002 127.670623c-0.308412 3.724666 0.640548 6.879956 2.846878 9.489594 110.482596 125.737118 119.414676 259.979284 26.808103 402.714637l-11.387513 0.47448c-20.639867-25.503283-31.552899-76.15399 10.675793-89.202182 4.033077-1.209923 7.271401-3.51115 9.015114-6.405476 11.470547-18.741948 11.079101-36.961968-1.186199-54.683784-1.708127-2.550328-5.195553-4.377075-9.489594-4.982037l-58.479622-7.947535c-2.79943-0.35586-5.847962-3.001084-8.066154-6.998575l-25.977763-46.61763c-1.577645-2.91805-5.041347-5.100657-9.370974-5.930996l-100.352455-19.453667a19.489253 19.489253 0 0 1-10.082693-5.219277c-19.133394-19.216427-14.625836-32.893305 13.522671-41.042493 39.702088-11.541718 70.626302-25.218596 92.760779-41.042494 3.321358-2.336812 5.515826-5.693756 6.049616-9.252353l4.626177-27.638442c0.842201-4.970175 3.641632-9.370974 7.686571-12.099233 4.033077-2.728258 8.93208-3.499288 13.427776-2.135158 28.551815 8.469462 44.209645-2.206331 46.973489-32.027379z m15.77645 138.109176c-0.094896-4.151697-2.787568-8.066155-7.473055-10.913033-4.697349-2.823154-11.007929-4.329627-17.555749-4.175422-6.535958 0.142344-12.775366 1.933505-17.330371 4.982037-4.566867 3.03667-7.069747 7.081609-6.974851 11.233307 0.094896 4.151697 2.775706 8.066155 7.473055 10.901171 4.685487 2.835016 11.007929 4.341489 17.555749 4.187283 6.524096-0.142344 12.763504-1.933505 17.318508-4.982037 4.566867-3.03667 7.081609-7.081609 6.986714-11.233306z m53.378965 48.634168c-0.023724-8.706702-11.150273-15.740864-24.839012-15.693416-6.583406 0.023724-12.882124 1.708127-17.520162 4.685487-4.638039 2.965498-7.235815 6.998575-7.223954 11.185859 0.035586 8.706702 11.150273 15.729002 24.850874 15.681554 6.571544-0.023724 12.870262-1.708127 17.508301-4.673625 4.638039-2.97736 7.235815-6.998575 7.235815-11.185859z" fill="#28D1B3" p-id="2393"></path><path d="M776.596787 131.58508c171.524408 212.092422 98.691776 522.283519-162.983773 618.958756-134.906438 49.820368-263.371814 27.009756-385.396129-68.443695l48.278309-50.294847 38.076995 21.232966c156.815538 91.100101 334.033702 45.075571 434.504776-101.657274 69.511275-128.263722 61.08926-251.545408-25.266043-369.856918l52.785865-49.938988z" fill="#FFFFFF" p-id="2394"></path><path d="M450.74786 403.936423c20.331455 30.212494 24.993218 62.03822 13.997151 95.489037-16.488169 50.532087-13.878531 78.763629 6.405476 125.381258-31.31566-2.052125-61.243466-11.067239-89.795282-27.045342-3.62977-2.028401-7.710295-1.886057-9.964073 0.35586l-39.500435 39.619054c-2.135159 9.655662-7.900087 14.756318-17.318508 15.30197l-38.076995-21.232966-41.991453-44.956951c-61.20788-83.508426-80.815753-176.269205-58.835482-278.282338l68.799555-30.48532c4.246593-1.897919 8.125465-2.657086 10.794413-2.135159 54.565164 10.794413 55.276884 59.784441 63.817519 102.962093 1.779299 9.098148 7.805191 16.844029 16.250929 20.877106 45.075571 21.67186 83.555873 23.059713 115.417185 4.151698z m-183.62364 5.243c-0.23724-8.445738-11.482409-14.981696-25.099976-14.602112-6.535958 0.17793-12.763504 1.969091-17.318509 4.970174-4.543143 2.989222-7.034161 6.951127-6.915541 11.007929 0.23724 8.4576 11.470547 14.993558 25.088113 14.613975 6.54782-0.189792 12.775366-1.969091 17.318509-4.970175s7.034161-6.962989 6.915542-11.019791z m-12.692332 57.151079c23.652813 15.266384 39.073403 11.90944 46.26177-10.082694a7.117195 7.117195 0 0 0-3.795838-8.422014c-16.203481-7.591675-30.48532-7.069747-42.821792 1.542059a10.201313 10.201313 0 0 0 0.35586 16.962649z m175.201626 70.389062a14.234391 14.234391 0 0 0-14.210667-14.258115l-20.639867-0.035586a14.234391 14.234391 0 0 0-14.258114 14.210667v2.372398a14.234391 14.234391 0 0 0 14.210666 14.258115l20.639867 0.035586a14.234391 14.234391 0 0 0 14.258115-14.210667v-2.372398z" fill="#28D1B3" p-id="2395"></path><path d="M471.150487 624.806718c-20.284007-46.61763-22.893645-74.849171-6.405476-125.381258 10.996067-33.450818 6.334304-65.276543-13.997151-95.489037 30.12946-31.861311 53.663653-28.860227 70.578854 9.015114 1.613231 3.617908 2.028401 7.579813 1.186199 11.268892l-23.842604 104.504152c-0.830339 3.606046 0 7.401883 2.253778 10.319933 30.12946 38.278649 20.212835 66.86605-29.7736 85.762204z" fill="#22B69F" p-id="2396"></path><path d="M649.67347 540.349334l11.387513-0.47448 88.015982 11.506132c-100.471074 146.732844-277.689239 192.757374-434.504776 101.657274 9.418422-0.545652 15.18335-5.646308 17.318508-15.30197 121.632869 34.162538 226.801292 5.741204 315.528995-85.287724 4.353351-4.424523 5.100657-8.4576 2.253778-12.099232z" fill="#30A7FB" p-id="2397"></path><path d="M234.503741 586.848343l41.991453 44.956951-48.278309 50.294847-44.126611-43.889371zM548.846536 825.037148l-1.067579 63.698898c-20.877106 9.335388-44.992537 10.248761-72.358153 2.728259l-3.677218-63.461659 77.10295-2.965498z" fill="#F2671E" p-id="2398"></path><path d="M547.778957 888.736046c37.887203 7.994983 76.794538 10.486001 116.722003 7.473055l2.965499 58.361002h-361.790765c-9.370974-37.602515 4.626177-59.072721 44.838331-58.123762 41.754213 0.948959 83.389806-0.71172 124.906779-4.982036 27.365616 7.520503 51.481046 6.60713 72.358153-2.728259z" fill="#FDDD44" p-id="2399"></path><path d="M664.50096 896.209101c41.042493-5.930996 58.681276 11.707786 52.904486 52.904486l-8.422015 6.405476-41.516972-0.94896-2.965499-58.361002z" fill="#F8C52D" p-id="2400"></path><path d="M717.405446 949.113587l37.246656 11.980612a11.185859 11.185859 0 0 1 7.235815 7.828915c10.367381 38.041409-4.305903 54.019513-44.007991 47.922449l-8.896495-61.3265 8.422015-6.405476z" fill="#918191" p-id="2401"></path><path d="M305.675694 954.570103h361.790765l41.516972 0.94896 8.896495 61.3265-439.130954 0.355859a18.979188 18.979188 0 0 1-17.911608-12.810951c-12.644884-37.317828 2.301226-53.924617 44.83833-49.820368z" fill="#A69CA7" p-id="2402"></path><path d="M402.633306 177.900692a16.369549 24.198464 86.5 1 0 48.306659-2.954562 16.369549 24.198464 86.5 1 0-48.306659 2.954562Z" fill="#8DCAFC" p-id="2403"></path><path d="M597.842915 266.897076a15.65783 24.672944 88.7 1 0 49.333186-1.119527 15.65783 24.672944 88.7 1 0-49.333186 1.119527Z" fill="#A9ECDB" p-id="2404"></path><path d="M650.97844 314.58354a15.77645 24.791564 89.8 1 0 49.582826-0.173078 15.77645 24.791564 89.8 1 0-49.582826 0.173078Z" fill="#A9ECDB" p-id="2405"></path><path d="M217.787951 410.556328a15.30197 24.672944 88.4 1 0 49.326649-1.377818 15.30197 24.672944 88.4 1 0-49.326649 1.377818Z" fill="#22B69F" p-id="2406"></path><path d="M254.431888 466.330502a10.201313 10.201313 0 0 1-0.35586-16.962649c12.336472-8.611806 26.618311-9.133734 42.821792-1.542059a7.117195 7.117195 0 0 1 3.795838 8.422014c-7.188367 21.992134-22.608957 25.349077-46.26177 10.082694z" fill="#22B69F" p-id="2407"></path><path d="M380.551817 522.394893m14.234369 0.024844l20.639835 0.036023q14.234369 0.024844 14.209526 14.259213l-0.004141 2.372395q-0.024844 14.234369-14.259213 14.209525l-20.639835-0.036023q-14.234369-0.024844-14.209525-14.259213l0.00414-2.372395q0.024844-14.234369 14.259213-14.209525Z" fill="#A9ECDB" p-id="2408"></path></svg>
}

export function MybricksGroupIcon2({width, height}) {
  return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1054" width={width} height={height}><path d="M782.23 825.42l90.48-90.48a30 30 0 0 0 0-42.4l-59.36-59.36-44.29 44.29a37 37 0 0 1-52.28 0 37 37 0 0 1 0-52.28l44.28-44.29-320.42-320.43-44.29 44.29a37 37 0 0 1-52.28 0 37 37 0 0 1 0-52.28l44.29-44.29-58.28-58.28a30 30 0 0 0-42.4 0l-90.48 90.48z" fill="#FF0000" p-id="1055"></path><path d="M197.1 240.29l585 585-38.39 38.39a30 30 0 0 1-42.43 0l-542.6-542.6a30 30 0 0 1 0-42.43z" fill="#E50B00" p-id="1056"></path><path d="M872.73 278.7l-129-129a30 30 0 0 0-42.39 0l-531.9 531.9a29.92 29.92 0 0 0-8.67 23.78l3.06 124a30 30 0 0 0 29.26 29.26l124 3.06-0.08-0.09a29.89 29.89 0 0 0 23.82-8.61l531.9-531.9a30 30 0 0 0 0-42.4z" fill="#FF5D01" p-id="1057"></path><path d="M873.2 320.75l-90.87 90.87-171.4-171.4 90.87-90.87a30 30 0 0 1 42.43 0l129 129a30 30 0 0 1-0.03 42.4z" fill="#FF7639" p-id="1058"></path></svg>
}

export function MybricksGroupIcon3({width, height}) {
  return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6542" width={width} height={height}><path d="M795.54 824H232.46A63.46 63.46 0 0 1 169 760.54V268.25A134.26 134.26 0 0 1 303.25 134h492.29A63.46 63.46 0 0 1 859 197.46v563.08A63.46 63.46 0 0 1 795.54 824z" fill="#3AAF09" p-id="6543"></path><path d="M170 191m69.97 0l493.06 0q69.97 0 69.97 69.97l0 550.06q0 69.97-69.97 69.97l-493.06 0q-69.97 0-69.97-69.97l0-550.06q0-69.97 69.97-69.97Z" fill="#24D316" p-id="6544"></path><path d="M670.47 441.62l-46.63-34.39a21.42 21.42 0 0 0-25.44 0l-46.64 34.39a21.43 21.43 0 0 1-34.14-17.25V191h187v233.37a21.43 21.43 0 0 1-34.15 17.25z" fill="#E1FFC7" p-id="6545"></path><path d="M264.52 600.83m33.48 0l372.14 0q33.48 0 33.48 33.48l0 0q0 33.48-33.48 33.48l-372.14 0q-33.48 0-33.48-33.48l0 0q0-33.48 33.48-33.48Z" fill="#5FE52E" p-id="6546"></path><path d="M263.52 718.84m33.48 0l372.14 0q33.48 0 33.48 33.48l0 0q0 33.48-33.48 33.48l-372.14 0q-33.48 0-33.48-33.48l0 0q0-33.48 33.48-33.48Z" fill="#5FE52E" p-id="6547"></path></svg>
}

export function MybricksGroupIcon4({width, height}) {
  return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8784" width={width} height={height}><path d="M470.73 683.4m54.08 0l0 0q54.08 0 54.08 54.08l0 124.44q0 54.08-54.08 54.08l0 0q-54.08 0-54.08-54.08l0-124.44q0-54.08 54.08-54.08Z" fill="#FFB05A" p-id="8785"></path><path d="M498 862.19V737.75a54.1 54.1 0 0 1 40.58-52.38 54.16 54.16 0 0 0-13.5-1.7A54.08 54.08 0 0 0 471 737.75v124.44a54.08 54.08 0 0 0 54.08 54.08 54.16 54.16 0 0 0 13.5-1.7A54.09 54.09 0 0 1 498 862.19z" fill="#EF9529" p-id="8786"></path><path d="M709.38 749.86s-42.69 25-184.57 25c-129.1 0-185.74-25-185.74-25-27.09-11-48.61-33.39-48.61-60.24V354.68c0-128 103.72-231.68 231.67-231.68a48.61 48.61 0 0 1 48.61 48.61 131.8 131.8 0 0 0 128.12 131.75l11.88 0.33A48.6 48.6 0 0 1 758 352.28v337.34c0 26.85-19.2 46.87-48.62 60.24z" fill="#FF72B4" p-id="8787"></path><path d="M470.15 575.41m-30.82 0a30.82 30.82 0 1 0 61.64 0 30.82 30.82 0 1 0-61.64 0Z" fill="#FEC1DC" p-id="8788"></path><path d="M377.61 749.4C350.52 738.35 329 716 329 689.16V354.21c0-118.89 89.56-216.84 204.89-230.12a48.64 48.64 0 0 0-12.21-1.55c-128 0-231.68 103.72-231.68 231.67v335c0 26.85 21.52 49.19 48.61 60.24 0 0 56.64 25 185.74 25 7 0 13.8-0.07 20.35-0.18C428.79 772 377.61 749.4 377.61 749.4z" fill="#FF52A9" p-id="8789"></path><path d="M290.46 399.29V355.1c0-128 103.72-231.68 231.67-231.68A48.61 48.61 0 0 1 570.75 172a131.8 131.8 0 0 0 128.11 131.78l11.88 0.33A48.6 48.6 0 0 1 758 352.7v46.59c0 3.7 0 37.14-24.42 40.63-54.66 0-25.59-62.8-57-61.64-50 0-4.65 86.06-61.64 86.06-36.05 0-23.26-66.29-57-66.29-73.27 0-16.28 118.63-87.22 118.63-67.46 0-17.45-143-76.76-143-41.87 0-24.43 70.94-68.62 70.94-27.9-0.05-34.88-33.17-34.88-45.33z" fill="#FEC1DC" p-id="8790"></path><path d="M327 397.79V353.6c0-119.36 90.26-217.6 206.24-230.28a48.47 48.47 0 0 0-11.56-1.4C393.72 121.92 290 225.65 290 353.6v44.19c0 12.16 7 45.29 34.89 45.29 8 0 14-2.36 18.71-6.19-12.87-10.18-16.6-30.22-16.6-39.1z" fill="#FFB0D6" p-id="8791"></path></svg>
}

export function MybricksGroupIcon5({width, height}) {
  return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="977" width={width} height={height}><path d="M88.32 91.6992m236.032 0l372.2752 0q236.032 0 236.032 236.032l0 372.2752q0 236.032-236.032 236.032l-372.2752 0q-236.032 0-236.032-236.032l0-372.2752q0-236.032 236.032-236.032Z" fill="#41DAB2" p-id="978"></path><path d="M301.6704 325.7344a366.2848 366.2848 0 0 0-213.3504 68.1984v306.0736a236.032 236.032 0 0 0 236.032 236.032H578.56a367.7696 367.7696 0 0 0-276.48-610.304z" fill="#64DFBF" p-id="979"></path><path d="M747.52 403.7632l-105.728-79.5136V263.5264a28.2112 28.2112 0 0 1 28.2112-28.0064h49.152a28.2112 28.2112 0 0 1 28.16 28.2112z" fill="#B5EFE1" p-id="980"></path><path d="M209.6128 485.4784a31.744 31.744 0 0 1 5.12-44.6464L490.3424 220.16a36.1472 36.1472 0 0 1 45.3632 0l270.8992 220.16a31.744 31.744 0 0 1 4.6592 44.6976 31.8464 31.8464 0 0 1-44.7488 4.6592l-253.7472-205.824L254.3104 490.496a31.7952 31.7952 0 0 1-44.6976-5.0176z" fill="#FFFFFF" p-id="981"></path><path d="M515.072 340.4288l-244.5824 193.28v208.9984a63.8976 63.8976 0 0 0 63.8976 63.8976h357.12a63.9488 63.9488 0 0 0 63.9488-63.8976v-208.9984z m18.0736 366.6944a36.4032 36.4032 0 0 1-40.3456 0c-114.432-76.3904-102.4-147.0464-59.3408-173.3632 26.9824-16.4352 57.1392 2.048 71.2704 13.056a13.312 13.312 0 0 0 16.4352 0c14.1824-11.008 44.3392-29.4912 71.3216-13.056 43.1616 26.3168 55.04 96.9728-59.3408 173.3632z" fill="#FFFFFF" p-id="982"></path></svg>
}

export function MybricksGroupIcon6({width, height}) {
  return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1499" width={width} height={height}><path d="M512 320c-12.8 0-21.333333-8.533333-21.333333-21.333333V213.333333c0-34.133333 29.866667-64 64-64s64 29.866667 64 64c0 12.8 8.533333 21.333333 21.333333 21.333334s25.6-8.533333 25.6-21.333334V153.6c0-12.8 8.533333-21.333333 21.333333-21.333333s21.333333 8.533333 21.333334 21.333333V213.333333c0 34.133333-29.866667 64-64 64-38.4 0-68.266667-29.866667-68.266667-64 0-12.8-8.533333-21.333333-21.333333-21.333333s-21.333333 8.533333-21.333334 21.333333v85.333334c0 12.8-8.533333 21.333333-21.333333 21.333333z" fill="#D04C83" p-id="1500"></path><path d="M512 341.333333m-85.333333 0a85.333333 85.333333 0 1 0 170.666666 0 85.333333 85.333333 0 1 0-170.666666 0Z" fill="#4F2AB5" p-id="1501"></path><path d="M512 448c-59.733333 0-106.666667-46.933333-106.666667-106.666667s46.933333-106.666667 106.666667-106.666666 106.666667 46.933333 106.666667 106.666666-46.933333 106.666667-106.666667 106.666667z m0-170.666667c-34.133333 0-64 29.866667-64 64s29.866667 64 64 64 64-29.866667 64-64-29.866667-64-64-64z" fill="#301196" p-id="1502"></path><path d="M320 345.6h384c128 0 234.666667 106.666667 234.666667 234.666667v85.333333c0 128-106.666667 234.666667-234.666667 234.666667h-384c-128 0-234.666667-106.666667-234.666667-234.666667v-85.333333c0-132.266667 106.666667-234.666667 234.666667-234.666667z" fill="#4F2AB5" p-id="1503"></path><path d="M320 341.333333h384c128 0 234.666667 106.666667 234.666667 234.666667S832 810.666667 704 810.666667h-384c-128 0-234.666667-106.666667-234.666667-234.666667S192 341.333333 320 341.333333z" fill="#723FDB" p-id="1504"></path><path d="M704 832h-384c-140.8 0-256-115.2-256-256s115.2-256 256-256h384c140.8 0 256 115.2 256 256s-115.2 256-256 256z m-384-469.333333c-119.466667 0-213.333333 93.866667-213.333333 213.333333s93.866667 213.333333 213.333333 213.333333h384c119.466667 0 213.333333-93.866667 213.333333-213.333333s-93.866667-213.333333-213.333333-213.333333h-384z" fill="#301196" p-id="1505"></path><path d="M704 917.333333h-384c-140.8 0-256-115.2-256-256v-85.333333c0-140.8 115.2-256 256-256h384c140.8 0 256 115.2 256 256v85.333333c0 140.8-115.2 256-256 256z m-384-554.666666c-119.466667 0-213.333333 93.866667-213.333333 213.333333v85.333333c0 119.466667 93.866667 213.333333 213.333333 213.333334h384c119.466667 0 213.333333-93.866667 213.333333-213.333334v-85.333333c0-119.466667-93.866667-213.333333-213.333333-213.333333h-384z" fill="#301196" p-id="1506"></path><path d="M320 785.066667c-115.2 0-209.066667-93.866667-209.066667-209.066667s93.866667-209.066667 209.066667-209.066667h384c115.2 0 209.066667 93.866667 209.066667 209.066667s-93.866667 209.066667-209.066667 209.066667h-384z" fill="#7750E2" p-id="1507"></path><path d="M785.066667 469.333333l51.2 51.2c34.133333 34.133333 34.133333 85.333333 0 119.466667l-51.2 51.2c-34.133333 34.133333-85.333333 34.133333-119.466667 0L614.4 640c-34.133333-34.133333-34.133333-85.333333 0-119.466667l51.2-51.2c34.133333-34.133333 85.333333-34.133333 119.466667 0z" fill="#4F2AB5" p-id="1508"></path><path d="M725.333333 503.466667m-34.133333 0a34.133333 34.133333 0 1 0 68.266667 0 34.133333 34.133333 0 1 0-68.266667 0Z" fill="#EDC35B" p-id="1509"></path><path d="M725.333333 652.8m-34.133333 0a34.133333 34.133333 0 1 0 68.266667 0 34.133333 34.133333 0 1 0-68.266667 0Z" fill="#EDC35B" p-id="1510"></path><path d="M802.133333 576m-34.133333 0a34.133333 34.133333 0 1 0 68.266667 0 34.133333 34.133333 0 1 0-68.266667 0Z" fill="#EDC35B" p-id="1511"></path><path d="M648.533333 576m-34.133333 0a34.133333 34.133333 0 1 0 68.266667 0 34.133333 34.133333 0 1 0-68.266667 0Z" fill="#EDC35B" p-id="1512"></path><path d="M290.133333 708.266667c-29.866667 0-55.466667-25.6-59.733333-55.466667v-17.066667H213.333333c-29.866667 0-55.466667-25.6-59.733333-55.466666 0-29.866667 25.6-55.466667 55.466667-59.733334h17.066666v-17.066666c0-29.866667 25.6-55.466667 59.733334-55.466667 29.866667 0 55.466667 25.6 55.466666 55.466667v17.066666h17.066667c29.866667 0 55.466667 25.6 59.733333 55.466667s-25.6 55.466667-55.466666 59.733333h-17.066667v17.066667c0 29.866667-25.6 55.466667-55.466667 55.466667z" fill="#4F2AB5" p-id="1513"></path><path d="M362.666667 546.133333h-42.666667v-42.666666c0-17.066667-12.8-34.133333-34.133333-34.133334s-29.866667 17.066667-29.866667 34.133334v42.666666H213.333333c-17.066667 0-34.133333 12.8-34.133333 34.133334s12.8 34.133333 34.133333 34.133333h42.666667v42.666667c0 12.8 12.8 25.6 29.866667 25.6s34.133333-12.8 34.133333-34.133334v-42.666666h42.666667c17.066667 0 34.133333-12.8 34.133333-34.133334s-17.066667-25.6-34.133333-25.6z" fill="#6ED6AB" p-id="1514"></path><path d="M439.466667 652.8h42.666666c12.8 0 21.333333 8.533333 21.333334 21.333333s-8.533333 21.333333-21.333334 21.333334h-42.666666c-12.8 0-21.333333-8.533333-21.333334-21.333334s12.8-21.333333 21.333334-21.333333zM541.866667 652.8h42.666666c12.8 0 21.333333 8.533333 21.333334 21.333333s-8.533333 21.333333-21.333334 21.333334h-42.666666c-12.8 0-21.333333-8.533333-21.333334-21.333334s8.533333-21.333333 21.333334-21.333333z" fill="#301196" p-id="1515"></path></svg>
}

export const mybricksGroupIcons = [
  { key: 'MybricksGroupIcon0', Icon: MybricksGroupIcon0 },
  { key: 'MybricksGroupIcon1', Icon: MybricksGroupIcon1 },
  { key: 'MybricksGroupIcon2', Icon: MybricksGroupIcon2 },
  { key: 'MybricksGroupIcon3', Icon: MybricksGroupIcon3 },
  { key: 'MybricksGroupIcon4', Icon: MybricksGroupIcon4 },
  { key: 'MybricksGroupIcon5', Icon: MybricksGroupIcon5 },
  { key: 'MybricksGroupIcon6', Icon: MybricksGroupIcon6 }
]

const mybricksIconMap = {
  MybricksGroupIcon0,
  MybricksGroupIcon1,
  MybricksGroupIcon2,
  MybricksGroupIcon3,
  MybricksGroupIcon4,
  MybricksGroupIcon5,
  MybricksGroupIcon6 
}
